package com.community.system.service.impl;

import java.util.List;
import com.community.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.community.system.mapper.PatrolMapper;
import com.community.system.domain.Patrol;
import com.community.system.service.IPatrolService;

/**
 * patrolService业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-27
 */
@Service
public class PatrolServiceImpl implements IPatrolService 
{
    @Autowired
    private PatrolMapper patrolMapper;

    /**
     * 查询patrol
     * 
     * @param patrolId patrol主键
     * @return patrol
     */
    @Override
    public Patrol selectPatrolByPatrolId(Long patrolId)
    {
        return patrolMapper.selectPatrolByPatrolId(patrolId);
    }

    /**
     * 查询patrol列表
     * 
     * @param patrol patrol
     * @return patrol
     */
    @Override
    public List<Patrol> selectPatrolList(Patrol patrol)
    {
        return patrolMapper.selectPatrolList(patrol);
    }

    /**
     * 新增patrol
     * 
     * @param patrol patrol
     * @return 结果
     */
    @Override
    public int insertPatrol(Patrol patrol)
    {
        patrol.setCreateTime(DateUtils.getNowDate());
        return patrolMapper.insertPatrol(patrol);
    }

    /**
     * 修改patrol
     * 
     * @param patrol patrol
     * @return 结果
     */
    @Override
    public int updatePatrol(Patrol patrol)
    {
        patrol.setUpdateTime(DateUtils.getNowDate());
        return patrolMapper.updatePatrol(patrol);
    }

    /**
     * 批量删除patrol
     * 
     * @param patrolIds 需要删除的patrol主键
     * @return 结果
     */
    @Override
    public int deletePatrolByPatrolIds(Long[] patrolIds)
    {
        return patrolMapper.deletePatrolByPatrolIds(patrolIds);
    }

    /**
     * 删除patrol信息
     * 
     * @param patrolId patrol主键
     * @return 结果
     */
    @Override
    public int deletePatrolByPatrolId(Long patrolId)
    {
        return patrolMapper.deletePatrolByPatrolId(patrolId);
    }
}
